home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 66
/
Vol 66.iso
/
games
/
doodle_d.swf
/
scripts
/
DefineSprite_8_en14
/
frame_1
/
DoAction.as
Wrap
Text File
|
2013-04-24
|
1KB
|
60 lines
function onEnterFrame()
{
if(_root.shieldMC.hitTest(_X,_Y,true) && _root.shieldLevel >= 2)
{
dx = 0;
dy = 0;
}
_X = _X + dx;
_Y = _Y + dy;
_rotation = _rotation + rot;
if(_X < 0 || _X > 640)
{
dx *= -1;
}
if(_Y > 880 || _Y < 0)
{
dy *= -1;
}
if(this.hitTest(_root.ship))
{
depth = _root.getNextHighestDepth();
_root.attachMovie("exp","exp" + depth,depth);
exp = eval("_root.exp" + depth);
exp._x = _X;
exp._y = _Y;
_root.death();
_root.eAmount--;
this.removeMovieClip();
}
if(h <= 0)
{
_root.eAmount--;
_root.points += 420;
_root.eD = _root.eD + 1;
depth = _root.getNextHighestDepth();
_root.attachMovie("exp","exp" + depth,depth);
exp = eval("_root.exp" + depth);
exp._x = _X;
exp._y = _Y;
this.removeMovieClip();
}
}
fx = Math.floor(Math.random() * 3) - 1;
if(fx == 0)
{
fx = Math.floor(Math.random() * 3) - 1;
}
if(fx == 0)
{
fx = Math.floor(Math.random() * 3) - 1;
}
if(fx == 0)
{
fx = Math.floor(Math.random() * 3) - 1;
}
dx = fx * Math.random() * 8 + fx * 4;
dy = Math.random() * 4;
rot = Math.random() * 10 + 10;
h = 10;